package org.jeecg.modules.orderForm.mapper;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.orderForm.entity.AggregationResult;
import org.jeecg.modules.orderForm.entity.OrderForm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.orderForm.entity.VisitorAggregationsResult;

/**
 * @Description: 订单
 * @author： jeecg-boot
 * @date：   2021-03-30
 * @version： V1.0
 */
public interface OrderFormMapper extends BaseMapper<OrderForm> {
    List<OrderForm> getGroupBytakeOrdersMoney(@Param("num")Integer num);
    /**
     * 计算 当天/当月/当年 总利润,总业绩
     * @param params 查询参数Map
     * @return AggregationResult
     * @author lixiao
     * @date 2021/4/8
     */
    AggregationResult queryTotalAggregations(Map<String,Object> params);
    /**
     * 按月查询历史业绩
     * @param map 查询参数Map
     * @return List<AggregationResult>
     * @author lixiao
     * @date 2021/4/8
     */
    List<AggregationResult> queryAggregationsByMonth(Map<String,Object> map);

    /**
     * 查询订单表里的有效年份数据
     * @return List<String>
     * @author lixiao
     * @date 2021/4/9
     */
    List<String> queryDistinctYearList();


    /**
     * 按照用户聚合业绩，单量
     * @param page 分页参数
     * @param map 查询参数
     * @return IPage<VisitorAggregationsResult>
     * @author lixiao
     * @date 2021/4/9
     */
    IPage<VisitorAggregationsResult> queryVisitorAggregations(IPage<VisitorAggregationsResult> page,@Param("queryMap") Map<String,Object> map);


}
